package com.yeyaomai.dksns.flowis.dao.impl;

import java.util.List;
import org.springframework.data.mongodb.core.query.Order;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;
import com.yeyaomai.dksns.flowis.dao.MongoDBBasicDao;
import com.yeyaomai.dksns.flowis.dao.PageDao;
import com.yeyaomai.dksns.flowis.domain.flowisdetail.PageEntity;

@Component
public class PageDaoImpl extends MongoDBBasicDao<PageEntity>
implements PageDao{

	@Override
	public void insert(PageEntity dto) {
		
		super.save(dto);
	}

	@Override
	public List<PageEntity> findList() {
		Query query = new Query();
		query.sort().on("visitCount", Order.DESCENDING);
		query.limit(500);
		return super.findList(query, PageEntity.class);
	}

	@Override
	public void delPage() {
		super.dropCollection("referPage");
		
	}

}
